#pragma once
#include "shapebuilder.h"
#include <Handle_TColgp_HArray1OfPnt.hxx>

#define SPLINE_CUID _T("ECEE032C-6AA8-40E1-8FAB-86EF25F48657")

class TFunction_Logbook;
class PRMAPI CSplineInfo : public CShapeInfo
{
public:
	CSplineInfo();
	~CSplineInfo();
	virtual void Reset();

	virtual void GetParams(CVarList& varList, UINT nID);
	virtual void SetParams(const CVarList& varList, UINT nID);

	virtual bool GetFromLabel(TDF_Label& label);
	virtual void AddToLabel(TDF_Label& label);
	virtual bool ModifyLabel(TDF_Label& label, TFunction_Logbook& log);

	static bool IsModified(TDF_Label& label, const TFunction_Logbook& log);
	//-----------------------------------
	gp_Pnt	ptStart;
	gp_Pnt	ptEnd;
	int		nPointCount;
	Handle(TColgp_HArray1OfPnt)	hPoints;
	//----------------------------------
	enum PARAM_INDEX_SPLINE
	{
		IDX_START = 0,

		START_POINT	= 1,
		START_X = START_POINT,
		START_Y,
		START_Z,

		END_POINT = 4,
		END_X = END_POINT,
		END_Y,
		END_Z,

		POINT_COUNT = 7,
		POINT_ARRAY = 8,
		IDX_END
	};
};

//////////////////////////////////////////////////////////////////////////

class PRMAPI CSplineBuilder : public CShapeBuilder
{
public:
	CSplineBuilder();
	~CSplineBuilder();

	bool Build(const CString& szCmdParam, TopoDS_Shape& shape);
	bool Build(CSplineInfo* pShapeInfo, TopoDS_Shape& shape);
};